//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class SmartTagProperties: IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read(xmlName))
            {
                Embedded = c.GetOptionalBoolean("embed", false);
                Visibility = c.GetOptionalEnum("show", SmartTagVisibility.All);
            }
        }

        private const string xmlName = "smartTagPr";

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write(xmlName))
            {
                c.SetOptionalBoolean("embed", Embedded, false);
                c.SetOptionalEnum("show", Visibility, SmartTagVisibility.All);
            }
        }

        #endregion

        private bool _embed;

        public bool Embedded
        {
            get { return _embed; }
            set { _embed = value; }
        }
        private SmartTagVisibility _show;

        public SmartTagVisibility Visibility
        {
            get { return _show; }
            set { _show = value; }
        }
	
    }
}
